#ifndef CHAT_H_
#define CHAT_H_

#include "interfaces/MessageHandlerInterface.h"
#include "interfaces/Useroutputinterface.h"
#include "Userdatabase.h"
#include "Transport.h"

using namespace std;

class Chat : public MessageHandlerInterface
{
public:
    Chat(Userdatabase* users, Transport* transport);
    virtual ~Chat();
    
    virtual void handleMessage(
            TransportMessage* msg,
            TransportMessage::MESSAGE_TYPE type,
            uint8_t subtype,
            UserPtr user
        );
    void send_chat(ptree& command_pt, Useroutputinterface& sending_ui);

private:
    typedef enum _Subtypes
    {
        UNDEFINED = 0,
        MESSAGE = 99,
        ACK = 100
    } Subtypes;
    
    Useroutputinterface* ui;
    Userdatabase* users;
    Transport* transport;
};

#endif /* CHAT_H_ */
